﻿@using Controllers
@{
    var func=new MyFunc();
}
<!DOCTYPE html>
<html>
<head>
@Html.Partial("_top")
</head>
<body>
@Html.Partial("_header")
<div class="mainbg">
	<div class="w1200 mt20 cl">
		<div class="w260 fl">		
@Html.Partial("_left")
		</div>

		<div class="w900 fr">
			<div class="newt_1 rel"><span class="abs fs16 fb">@ViewBag.model.title</span><h1>当前位置：@Html.Raw(ViewBag.model.cur)</h1></div>
						<div class="zxhdcon cl">		

				<form id="ajaxForm" action="/Tou?id=@ViewBag.model.ID" method="post">						
	  @{var toupiaolist=func.GetToupiaoList(cid:0);}
	  @for(var i=0;i<toupiaolist.Count;i++){
	  var litem=toupiaolist[i];
				<dl class="msg_2">
					<dt>@(i+1)、@litem.title</dt>
					<dd>				
					@{var toupiao=func.GetToupiaoList(cid:litem.ID);}
                    @for(var j=0;j<toupiao.Count;j++){	
	  var item=toupiao[j];
						<span class="select_1" data-value="@item.ID">@item.title</span>	
                    } 
						<input name="list_@litem.ID" type="hidden" value="" />
					</dd>
				</dl>
	  }
				<ul style="margin-left: 20px;">
					<li><span id="btnSave" class="btn_1 bgcol_2">提 交</span><span id="btnCancel" class="btn_1 bgcol_3">重 填</span></li>
				</ul><input type="submit" id="tj" style="display:none;" />
				</form>
			</div>

		</div>
	</div>
</div>

<script type="text/javascript">
	$(function(){
		$(".msg_2 dd span.select_1").click(function(){
			$(this).addClass("selected").siblings(".select_1").removeClass("selected");
			$(this).siblings("input").val($(this).attr("data-value"));
		});
	});
</script>


<script type="text/javascript">
	$(function(){
		$("#btnSave").click(function(e1){
			$("#tj").click();
		});
		  $("form").submit(function(e){
			if($("input[name='username']").val().length<2){
			alert("请输入姓名");
			return false;
			}			
			if($("input[name='tel']").val().length<7){
			alert("请输入正确电话号码");
			return false;
			}			
			if($("input[name='title']").val().length<5){
			alert("请输入标题");
			return false;
			}			
			if($("input[name='content']").val().length<20){
			alert("请输入正确内容");
			return false;
			}			
			if($("input[name='code']").val().length<4){
			alert("请输入正确的验证码");
			return false;
			}
		  });
	});
	function ToggleCode(obj, url) {
		obj.src = url+"?"+new Date();
	}

</script>
<div id="footer">
	@Html.Raw(ViewBag.model.copyright)
</div>

</body>
</html>